package Str;

import java.util.Arrays;
import java.util.Locale;

/**
 * @auther wangchenghao
 * @date 2021/6/7
 **/
public class test5 {
    public static  boolean isPalindrome(String s) {
        s = s.replaceAll("[^A-Za-z0-9]", "");
        String last=s.toLowerCase();
        String first= reverse1(last);
        if (last.equals(first)){
            return true;
        }else {
            return false;
        }
    }
    public static String reverse1(String str)

    {
        return new StringBuffer(str).reverse().toString();

    }

    public static void main(String[] args) {
        System.out.println("isPalindrome(\"dsdddddsd\") = " + isPalindrome("0P"));
    }
}
